﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace ExamSharedClasses
{
    /// <summary>
    /// (k) Ein Modul ist Bestandteil eines Courses. Jeder Course besteht aus mehreren Modulen.
    /// </summary>
    [Serializable()]
    public class Module 
    {
        public const String TABLENAME = "module";
        public const String MODULE_ID = "module_id";
        public const String MODULE_NAME = "module_name";
        public const String MODULE_DESCRIPTION = "module_description";

        public int ModuleId { get; set; }
        public String ModuleName { get; set; }
        public String ModuleDescription { get; set; }

        public Module()
        {
            ModuleId = -1;
            ModuleName = "";
            ModuleDescription = "";
        }
        public override string ToString() {
            StringBuilder sb = new StringBuilder( "Module: " );
            sb.Append( "ID: "  + ModuleId.ToString() + ", " );
            if ( ModuleName != null )
                sb.Append( "NAME: " + ModuleName.ToString() + ", " );
            if ( ModuleDescription != null )
                sb.Append( "DESCR: " + ModuleDescription.ToString() + '\n' );
            return sb.ToString();
        }
    }
}
